const path = require('path');
const fs_extra = require('fs-extra');
const fs_extend = require('../node_modules_ext/fs-extend.js');
const Config = require('../node_modules_ext/config.js');
const StaticServer = require('./static-server.js');
const SSLStaticServer = require('./static-sslserver.js');
const { SOFTWARE } = Config;

const init = () => {
    if (SOFTWARE?.static?.http?.port && SOFTWARE.static.http.port !== 'None') {
        StaticServer.run(SOFTWARE.static.http.port);
    }
    if (SOFTWARE?.static?.https?.port && SOFTWARE.static.https.port !== 'None') {
        SSLStaticServer.run(SOFTWARE.static.https.port);
    }
}

if (!module.parent) {
    init();
} else {
    module.exports = init;
}